package project.menu.ordermenu;

import project.controllers.Controller;
import project.controllers.CreatorObject;
import project.menu.IMenu;
import project.menu.IMenuItem;
import project.work.Navigator;
import controllers.IAutoservice;

public class CreatorOrder implements IMenuItem {

	private String name= "Add order";
	private final Integer id= 4;
	private static IMenu submenu;
	private Controller con;
	private Navigator n;
	
	public CreatorOrder(){
		con= Controller.getInstance();
		n=Navigator.getInstance();
	}
	
	
	public Integer getId() {
		return id;
	}
	
	public void action(IAutoservice aut) {
				//add order
	
		aut.addOrder(CreatorObject.addOrder(), con.getMasterName(), con.getNumberGarage());
		
		n.drawMenu(submenu);
	}

	public String getNameItem() {
		
		return name;
	}

	
	public static void setSubmenu(IMenu menu){
		 submenu=menu;
	}
}
